package com.example;

import java.util.Date;

public class Person {

    // 字段
    public String name = "Allen";
    private int age = 18;
    public static Date time;

    public int getAge() {
        return age;
    }

    // 构造方法
    public Person() {
        System.out.println("默认构造方法执行了");
    }

    public Person(String name) {
        System.out.println("姓名:" + name);
    }

    public Person(String name, int age) {
        System.out.println("姓名:" + name + ", 年龄:" + age);
    }

    private Person(int age) {
        System.out.println("年龄:" + age);
    }

    // 方法
    public void m1() {
        System.out.println("m1");
    }

    public void m2(String name) {
        System.out.println(name);
    }

    public String m3(String name, int age) {
        System.out.println(name + ":" + age);
        return null;
    }

    private void m4(Date date) {
        System.out.println(date);
    }

    public static void m5() {
        System.out.println("m5");
    }

    private static void m6(String[] args) {
        System.out.println(args.length);
    }

}
